extends "../biaoqiang-1/biaoqiang-1.gd"
func _extInit():
	._extInit()
	lv = 2             #等级的设置
	addSkill("每{cd}秒向当前目标投掷反舰标枪，降低目标40护甲并对目标造成[雷击*2.5]({damage})的技能伤害", "标枪突袭", "sk_javelin1", 8)

func _castCdSkill(id):
	._castCdSkill(id)
	if id=="sk_javelin1" and aiCha != null:
		sk_javelin1()

func sk_javelin1(cha = aiCha):
	if cha.att.def > 40:
		castBuff(cha, b_javelin.new())
	createFlyEff(sprcPos, cha, "sk_feiDang")
	if upgraded == 2:
		for i in getCellChas(cha.cell, 1, 1):
			azurHurtChara(i, getSkillEffect("标枪突袭"), sys.HurtType.WEAPON, sys.AtkType.SKILL, "标枪突袭")
	else:
		azurHurtChara(cha, getSkillEffect("标枪突袭"), sys.HurtType.WEAPON, sys.AtkType.SKILL, "标枪突袭")

class b_javelin:
	extends "../../../../azurlane_ctrl/AzurBuff.gd"
	func _init():
		attInit()
		id = "b_javelin"	
		att.def = -40

func getSkillEffect(name):
	.getSkillEffect(name)
	if name == "标枪突袭":
		return att.mgiAtk * 2.5